package com.cfpl.security;

import org.springframework.security.web.session.SessionInformationExpiredEvent;
import org.springframework.security.web.session.SessionInformationExpiredStrategy;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * @Auther: LYP
 * @Date: 2023/10/13 - 11:08
 * @Description: com.cfpl.admin_service.security
 * @version: 1.0
 * 异地登录
 */
@Component
public class CustomizeSessionInformationExpiredStrategy implements SessionInformationExpiredStrategy {
    @Override
    public void onExpiredSessionDetected(SessionInformationExpiredEvent sessionInformationExpiredEvent) throws IOException, ServletException {
        HandlerResponse.responseUserAccountLoginAtOthers(sessionInformationExpiredEvent.getResponse());
    }
}